﻿@{
    Layout = null;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="~/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/css/style.css" />
    <link href="~/assets/css/codemirror.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/assets/css/ace.min.css" />
    <link rel="stylesheet" href="~/font/css/font-awesome.min.css" />
    <link rel="stylesheet" href="~/layui-v2.5.4/layui/css/layui.css" media="all" />
    <!--[if lte IE 8]>
      <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
    <![endif]-->
    <script src="~/Scripts/jquery-1.9.1.min.js"></script>
    <script src="~/assets/js/bootstrap.min.js"></script>
    <script src="~/assets/js/typeahead-bs2.min.js"></script>
    <script src="~/assets/js/jquery.dataTables.min.js"></script>
    <script src="~/assets/js/jquery.dataTables.bootstrap.js"></script>
    <script src="~/assets/layer/layer.js" type="text/javascript"></script>
    <script src="~/Scripts/H-ui.js" type="text/javascript"></script>
    <script src="~/Scripts/displayPart.js" type="text/javascript"></script>
    <script src="~/assets/laydate/laydate.js" type="text/javascript"></script>
    <script src="~/layui-v2.5.4/layui/layui.js"></script>
    <title>系统日志</title>
</head>

<body>
    <div class="margin clearfix">
        <div id="system_style">
            <div class="search_style">

                <ul class="search_content clearfix">
                    <li><label class="l_f">名称</label><input name="" id="username" type="text" class="text_add" style=" width:250px"></li>
                    <li style="width:90px;"><button type="button" id="check" class="btn_search"><i class="fa fa-search"></i>查询</button></li>
                </ul>
            </div>
            <!--系统日志-->
            <div class="system_logs">
                <table class="layui-hide" id="test" lay-filter="demo"></table>            
            </div>
        </div>
    </div>
</body>
</html>
<script src="~/Scripts/Format.js"></script>
<script>
     //列表刷新
    function TableReload() {
        var table = layui.table;
        //获取页面管理员名称和时间
        var username = $("#username").val();
        //上述方法等价于
        table.reload('testReload', {
            where: { //设定异步数据接口的额外参数，任意设
                username: username,
            }
        });
    }


    //查询按钮点击事件
    $("#check").click(function () {       
        TableReload(null);
    });


   
    //layui
    layui.use('table', function () {
        var table = layui.table
        ,form = layui.form;
        table.render({
            elem: '#test'
            , url: '/SystemLogs/QueryPageList' //用集合查询信息获取列表
            , toolbar: '#toolbarDemo'
            , cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            , cols: [[
                { type: 'checkbox' }  //这段是加的
                , { field: 'Id', width:120, title: 'Id'}
                , { field: 'UserName', width: 170, title: '登录名' }                              
                , { field: 'Controller', title: '控制器', width:300, minWidth: 100 } //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
                , { field: 'Time', width: 250, title: '操作时间', templet: "<div>{{Format(d.Time,'yyyy-MM-dd hh:mm:ss')}}</div>" }
                , { field: 'Action', title: '操作内容', width: 300 }
               
            ]]
            , page: true
            , id: 'testReload'
        });
    });



  laydate({
    elem: '#start',
    event: 'focus'
});
$(function() {
  var oTable1 = $('#sample-table').dataTable( {
  "aaSorting":false,//默认第几个排序
  "bStateSave": true,//状态保存
  "aoColumnDefs": [
	//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	{"orderable":false,"aTargets":[0,1,2,3]}// 制定列不参与排序
  ]});
})
</script>

